<template>
    <div class="school">
        <h2>学校名称：{{ name }}</h2>
        <h2>学校地址：{{ address }}</h2>
    </div>
</template>

<script>
export default {
    // eslint-disable-next-line vue/multi-word-component-names
    name: 'School',
    data() {
        return {
            name: '尚硅谷',
            address: '北京',
        }
    },
    methods: {
        getStu(value) {
            console.log('收到Student传过来的数据：',value)
        }
    },
    mounted() {
        this.$bus.$on('stu', this.getStu)
    },
    beforeDestroy() {
        this.$bus.$off('stu')
    }
}
</script>

<style scoped>
.school {
    background-color: skyblue;
    padding: 5px;
}
</style>